package com.chazz.config;


import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {

//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2021000116685343";

	// 商户私钥，您的PKCS8格式RSA2私钥
	public static String merchant_private_key = "MIIEvgIBADANBgkqhkiG9w0BAQEFAASCBKgwggSkAgEAAoIBAQCIRTuD+P6j5OX5gjfMaCHzpAKHpIxozJRcOieJ2TuUg3rjNKfKmW2sI0N8NbH5fGF7EsXGxq6dbvvZnCqXnZPZLzzsUdmdBYkNQjicx0sXBv9SHs9GQoZgvfDgew6nj6VsTzYBT++adPKu80aDLpEgLuRQuqB8NtsTZfCJdzxZer+OOLRCQhrxjAmaGDURUBntfDN00Y6y4bFZukcmjIUcwlRKZYfs8bPF8n0YyDxG+iK87+JVLXXQDeU4aMj/c4yRB+qLhKWn3QHpZRf8N/MdK72fSO6JaeXoiCq3wpaf5yzkHSYpTtcgdH9TuGWchOgYL6Ijji2kccnlefA23ceBAgMBAAECggEAUDNG6s4ht/3gp+9OvbvPt6AgaQqcJJW6/2iumn/ChA65xXzY//E6zePXNQQ5IddlW9TZl7qZTEjkatdxbdgtCta1aXRmufZnCemefg8BD6VroT5GyVgf1FIVsVhbcJynRE5+P1l3cBVCO1ssdcpzWVifwS+FgnWajBkj7xPA7fvl+uy2myPekyKtmh9wZz0Fd1zy/zG4ULAEEp7c0Z2S/ANefA0juQG1fHXEuvQbT1xJzUts+zbvodlyIYS/WcWusKeGBkvCAjd0rNiv0nVs6ttldsW0E9APEVmJW56PnTFRdcXncwA8C1Laeigr/GjFMh7UmUc7FxmlWy7hNUAXQQKBgQDRM2fMqxKPXZch9SXGX7OtfemLamtOfFgZMXfD9wfjx/Ij7CccTARtm79HYzPdJUPx2dkmqiBrGnLvmWbwyk9Hj0d1Y2A1kYKYEqULD6M3y3QRV7YgWJbJy37y7rXCJYQCoeaOHfHW+RM7H6P7A8HA3kddso418CFLp9gy6pnuiQKBgQCmwTjYTLUh2vqMU10FWgnFnbsxiLgCkJnS3WuREuw897gBsyemZjZMh1mmk0DmzDp1+26le5HReO2mvvWFM09C/lonxPBaurEMYTReOJ00bmu/uaaodI/lhvC8TQXhH5eWV+hVkwjZLwNn3VQSbO0CbJTaoA7g9O9h7Y9kUeeTOQKBgEmOPInvAJid/Jy4+G42ihOPOQWHBnHTMJqzFPw3KHQDgnT0/I9rfwcXAvtTuxGfn7MyuLJqkPl3lEAAfPxe9d8gVqzEozhSkEtuCs/H0Mi2ZXoPj/7xhxsuzNUX75py3GacjFcd2kGO1B8usdZ5bK+muAsO1AfNBbf3LQJCEJuZAoGBAJNoKOTj4hZ8aZDUPF13uz2qcgiWj/sMcj35p5XFwXkfjdRK15j7r7I0z6Y1c2DSVjdnPOch9cPS/1mwYn8N3VoeV/nh2IqLj+ieoNlNeIIZvjvsVAuDhpRilboO6EyaTbkEGohTArZiHcOZ3jCvg0/qRieA58YqHtZVVrVaxbfZAoGBAIZChw36pzOp0nPipgOkhEt21SJId4G2qCFgdj7fJgC+4CEwmrOqRJzIF2Vf0kYjkszmNxYYiTMzJkbS8nCD1O0/dsR9tpuNkh9ibWaqOaditRn2lGErI/aW7HnLrF0CmvFOsdiG+nlWoS7cQMZm8OmakQpidbQjZLZE+YxbT/4L";

	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
	public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAyWFLZI5VyzMHONlGao8cJJnDU8Q3TXK3BlULVnJcLGOnTRlSygGC6l2QUZzuRxCthWseZisvnGzWEdVL+y0RLB35B2ymdsJpfOc5aL3CIuLkpCvNuiizBSaqvdf+xfkAPjNI3hTgSrr0Z/kUM0W732xg8tDCi8FXx7pIOdJMCLPYdqEjFPFSaweN33MNhhLc9ZeosSF9yT+KZ7+lrmPEn4t456Ip+A2EaOjSRzl6tdikD9CB6v8IwUK7LCzzXVtHFtAxcQtYInH2CFRXibtuQCc72MINbC48D7r1LzQtJbkjQWTlW6l+kKGdZ6uOVfxaPxHDfkEVSlONS+EToVvRcQIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String notify_url = "http://localhost:8080/foraging/notify_url.jsp";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_url ="http://localhost:8080/foraging/return_url.jsp"; //"http://81.69.6.155:8080/foraging/return_url.jsp";

	// 签名方式
	public static String sign_type = "RSA2";

	// 字符编码格式
	public static String charset = "utf-8";

	// 支付宝网关
	public static String gatewayUrl = "https://openapi.alipaydev.com/gateway.do";

	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

	/**
	 * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
	 * @param sWord 要写入日志里的文本内容
	 */
	public static void logResult(String sWord) {
		FileWriter writer = null;
		try {
			writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
			writer.write(sWord);
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			if (writer != null) {
				try {
					writer.close();
				} catch (IOException e) {
					e.printStackTrace();
				}
			}
		}
	}
}

